package com.antrom.devlo;

public class TauxConversion {

    public Double taux;
    public Devise estConverti;
    public Devise resConversion;

    public void definirTaux(double tauxConv) {
        if (tauxConv > 0) {
            this.taux = tauxConv;
        }
    }

    public TauxConversion(Devise deviseDepart, Devise deviseArrivee, double tauxConversion) {
        this.estConverti = deviseDepart;
        this.resConversion = deviseArrivee;
        this.taux = tauxConversion;
    }

    public void convertir() {
        this.resConversion.valeur = this.estConverti.valeur * this.taux;
    }
}